{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>新建</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择学校：</label>
                            <div class="layui-input-block">
                                <select name="grade_school_erp" lay-verify="required" lay-search>
                                <option value="">请选择</option>
                                {foreach name="schools" item="v"}
                                <option value="{$v.school_erp}">{$v.school_name}</option>
                                {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">选择年级：</label>
                            <div class="layui-input-block">
                                <select name="grade_level"  xm-select="select2" xm-select-search="" xm-select-search-type="dl">
                                    <option value="1">幼儿园-小班</option>
                                    <option value="2">幼儿园-中班</option>
                                    <option value="3">幼儿园-大班</option>
                                    <option value="4">小学-一年级</option>
                                    <option value="5">小学-二年级</option>
                                    <option value="6">小学-三年级</option>
                                    <option value="7">小学-四年级</option>
                                    <option value="8">小学-五年级</option>
                                    <option value="9">小学-六年级</option>
                                    <option value="10">初中-初一</option>
                                    <option value="11">初中-初二</option>
                                    <option value="12">初中-初三</option>
                                    <option value="13">高中/中专-高一</option>
                                    <option value="14">高中/中专-高二</option>
                                    <option value="15">高中/中专-高三</option>
                                    <option value="16">大专/大学-大一</option>
                                    <option value="17">大专/大学-大二</option>
                                    <option value="18">大专/大学-大三</option>
                                    <option value="19">大专/大学-大四</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('add')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        $("button").removeClass('layui-disabled').removeAttr('disabled');
                        wk.error(res.msg);
                        return false;
                    }
                }
            })
        });
    });
</script>

</body>
</html>
